#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>
void* s_memmove(void* s1, const void* s2,size_t a)
{
	void* s3 = s1;
	if (s1 < s2)
	{
		while (a--)
		{
			*(char*)s1 = *(char*)s2;
			((char*)s1)++;
			((char*)s2)++;
		}
	}
	else
	{
		while (a--)
		{
			*((char*)s1 + a) = *((char*)s2+ a);
		}
	}
	return s3;

}
int main()
{
	int arr2[10] = { 1,3,4,5,6,9 };
	int num = 3;
	s_memmove(arr2+2, arr2, num*sizeof(int));
	for (int i = 0; i < 10; i++)
	{
		printf("%d ", arr2[i]);
	}
	return 0;
}